/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package tugas1;

/**
 *
 * @author reziyus
 */
import java.util.Scanner;

public class Shape {
    private float rusuk1, rusuk2;
    private float height;
    
    public static float luasTrapesium (float rusuk1, float rusuk2, float height){
        return ((((rusuk2-rusuk1)/2)*height/2)*2)+(rusuk1*height);
    }
    
    
    public static float luasSegitiga (float rusuk1, float height){
	return ((rusuk1*height)/4);
    }
    
    public static float kelilingTrapesium(float rusuk1, float rusuk2, float height){
        float s = ((((rusuk2-rusuk1)/2)*((rusuk2-rusuk1)/2))+(height*height))*2;
        float m = (float) Math.sqrt(s);
        return (rusuk1+rusuk2)+ (m*2);
    }
    
    public float kelilingSegitiga(float rusuk1, float rusuk2){
		return ((2*rusuk2)+rusuk1);
    }
  
}

